#include "Train.h"

class Solution {
public:
    int findMin(vector<int>& nums) {
        int l = 0, r = nums.size() - 1;
        int x = nums[r];
        while (l < r)
        {
            int mid = (r - l) / 2 + l;
            if (nums[mid] <= x) r = mid;
            else l = mid + 1;
        }
        return l;
    }
};